package com.lihui.controller;

import com.lihui.entity.Student;
import com.lihui.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/student")
public class StudentController {

    @Autowired
    private StudentService studentService;

    @GetMapping("/findAll")
    public List<Student>  selectAllStudents(){
        List<Student> students = studentService.selectAll();
        System.out.println(students);
        return students;
    }
}
